/**
 * 权限管理相关的接口
 */

import request from '@/utils/request'

// TAG 根据ID更新权限点详情
export const updatePermission = data => {
  return request({
    method: 'PUT',
    url: `/sys/permission/${data.id}`,
    data
  })
}

// TAG根据ID获取权限点详情
export const getPermissionDetail = id => {
  return request({
    method: 'GET',
    url: `/sys/permission/${id}`
  })
}

// TAG 根据id删除权限点
export const delPermission = id => {
  return request({
    method: 'DELETE',
    url: `/sys/permission/${id}`
  })
}

// TAG 添加权限点
export const addPermission = data => {
  return request({
    method: 'POST',
    url: `/sys/permission`,
    data
  })
}

// TAG 获取所有权限点
export const getPermissionList = params => {
  return request({
    method: 'GET',
    url: '/sys/permission',
    params
  })
}
